using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TMS.Domain.Entity;
using TMS.Infrastructrue.Persistence.Configuration.Base;

namespace TMS.Infrastructrue.Persistence.Configuration
{
    public class TMSIdentityUserConfiguration:BaseEntityConfiguration<TMSIdentityUser>
    {
        public override void Configure(EntityTypeBuilder<TMSIdentityUser> builder)
        {
            base.Configure(builder);
            builder.ToTable("tms_identity_user");

            builder.Property(x => x.UserId).HasColumnName("user_id").HasMaxLength(200000).HasColumnOrder(1);
            // builder.Property(x => x.UserName).HasColumnName("user_name").HasMaxLength(200000).HasColumnOrder(2);
            builder.Property(x => x.RefreshToken).HasColumnName("refresh_token").HasMaxLength(200000).HasColumnOrder(3);
            builder.Property(x => x.RefreshTokenExpiration).HasColumnName("refresh_token_expiration").HasColumnOrder(4);
        }
    }
}